package cn.iocoder.yudao.module.pay.dal.mysql.order;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pay.controller.admin.order.vo.HuifuOrderPageReqVO;
import cn.iocoder.yudao.module.pay.dal.dataobject.order.HuifuOrderDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 汇付对帐订单 Mapper
 *
 * @author 万商汇
 */
@Mapper
public interface HuifuOrderMapper extends BaseMapperX<HuifuOrderDO> {

    default PageResult<HuifuOrderDO> selectPage(HuifuOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HuifuOrderDO>()
                .eqIfPresent(HuifuOrderDO::getUserTagId, reqVO.getUserTagId())
                .eqIfPresent(HuifuOrderDO::getHuifuId, reqVO.getHuifuId())
                .eqIfPresent(HuifuOrderDO::getSysId, reqVO.getSysId())
                .likeIfPresent(HuifuOrderDO::getSysShortName, reqVO.getSysShortName())
                .likeIfPresent(HuifuOrderDO::getSysIdName, reqVO.getSysIdName())
                .eqIfPresent(HuifuOrderDO::getProductNumber, reqVO.getProductNumber())
                .eqIfPresent(HuifuOrderDO::getHuiTerminalId, reqVO.getHuiTerminalId())
                .likeIfPresent(HuifuOrderDO::getHuiTerminalName, reqVO.getHuiTerminalName())
                .eqIfPresent(HuifuOrderDO::getHuiTerminalType, reqVO.getHuiTerminalType())
                .eqIfPresent(HuifuOrderDO::getPzNumber, reqVO.getPzNumber())
                .eqIfPresent(HuifuOrderDO::getHuifuOrderId, reqVO.getHuifuOrderId())
                .eqIfPresent(HuifuOrderDO::getOutsideOrderId, reqVO.getOutsideOrderId())
                .eqIfPresent(HuifuOrderDO::getExchangeType, reqVO.getExchangeType())
                .eqIfPresent(HuifuOrderDO::getExchangeWaySeq, reqVO.getExchangeWaySeq())
                .eqIfPresent(HuifuOrderDO::getExchangeWay, reqVO.getExchangeWay())
                .eqIfPresent(HuifuOrderDO::getProductRemarks, reqVO.getProductRemarks())
                .eqIfPresent(HuifuOrderDO::getExchangeMoney, reqVO.getExchangeMoney())
                .eqIfPresent(HuifuOrderDO::getHandlingFee, reqVO.getHandlingFee())
                .eqIfPresent(HuifuOrderDO::getRefundAmount, reqVO.getRefundAmount())
                .eqIfPresent(HuifuOrderDO::getPayStatus, reqVO.getPayStatus())
                .betweenIfPresent(HuifuOrderDO::getExchangeTime, reqVO.getExchangeTime())
                .eqIfPresent(HuifuOrderDO::getPayBank, reqVO.getPayBank())
                .eqIfPresent(HuifuOrderDO::getLoanTag, reqVO.getLoanTag())
                .betweenIfPresent(HuifuOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HuifuOrderDO::getId));
    }

}